package com.health.memberbackstage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.memberbackstage.mapper.OrderMapper;
import com.health.memberbackstage.pojo.Order;
import com.health.memberbackstage.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean addOrder(Order order) {
        int res = orderMapper.insertOrder(order);
        if (res >= 1){
            return true;
        }
        return false;
    }

    @Override
    public boolean addOR(Integer oid, Integer rid) {
        int res = orderMapper.insertOR(oid, rid);
        if (res >= 1){
            return true;
        }
        return false;
    }
}
